import req from './req.js';

export async function checkEnWord( wd ){
    try{
        let res = await req.request({
            baseurl: process.env.VUE_APP_HOST,
            url:  "/dict/checkword",
            method: "get",
            data: {
                word: wd
            },
            header:{
                "Content-Type": "application/json;charset=utf-8"
            }
        }
        );
    
        return res.data;
    }catch(err){
        console.log("bad request: ", err);
        return err.data;
    }
    
}

export async function getPublickey(){
    let res = await req.request({
        baseurl: process.env.VUE_APP_HOST,
        url:"/crypto/key",
        method: "get"
    });

    return res.data;
}